/**
 *This file is the intellectual property of the author, Jacques Heunis.
 *It may not be used without specific written permission.
 * 
 *@author Jacques Heunis
 */
package mathematitools;

/**
 *
 * @author D3zmodos
 */

import java.math.BigDecimal;

public class FunctionManager {
    
    public static BigDecimal resolveFunction(String funcName, BigDecimal value){
        if(funcName.equals("tan")){
            double answer = Math.tan(Math.toRadians(value.doubleValue()));
            return new BigDecimal(answer);
            
        }else if(funcName.equals("sin")){
            double answer = Math.sin(Math.toRadians(value.doubleValue()));
            return new BigDecimal(answer); 
        
        }else if(funcName.equals("cos")){
            double answer = Math.cos(Math.toRadians(value.doubleValue()));
            return new BigDecimal(answer); 
        } 
        
        return null;
    }
    
}
